﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lm.Common.Auth.Account
{
    [Operation.Operation("{ECAA2407-C6ED-44EA-A8D7-0C468683C771}", "帐号查询", "")]
    public class AccountSelector : Operation.OperationBase
    {
        static AccountSelector()
        { Operation.OperationBase.CreateOperation(typeof(AccountSelector)); }

        public AccountSelector(string token)
            : base(token)
        { }

        public List<Model.Account> GetAccountList(params System.Linq.Expressions.Expression<Func<Model.Account, bool>>[] conditions)
        {
            return DAL.DALFactory.Create().Select<Model.Account>(conditions);
        }

        public List<Model.Account> GetAccountList(long pageSize, long pageIndex, out long recordCount, params System.Linq.Expressions.Expression<Func<Model.Account, bool>>[] conditions)
        {
            return DAL.DALFactory.Create().Select<Model.Account>(pageSize, pageIndex, out recordCount, null, () => new Model.Account() { UserAccount = string.Empty }, Common.DAL.OrderByOption.ASC, conditions);
        }
    }
}
